<?php
include_once("team_repository.php");
$repTeam= new TeamRepository;
$teamID=$_POST['teamID'];
$player=array($_POST['player1'],$_POST['player2'],$_POST['player3']);


	$repTeam->deleteTeamMembers($teamID);
	for($i=0;$i<3;$i++){
		if($player[$i]!=""){
			$repTeam->AssignTeamMembers($teamID,$player[$i]);
		}
	}
	header('LOCATION:'.$_SERVER["HTTP_REFERER"]);

?>